package auth

import "time"

// 角色模型（占位）
type Role struct {
	ID          int64         `gorm:"primaryKey" json:"id"`
	Name        string        `gorm:"unique;size:100" json:"name"`
	Description string        `gorm:"size:255" json:"description"`
	CreatedAt   time.Time     `json:"created_at"`
	UpdatedAt   time.Time     `json:"updated_at"`
	Permissions []*Permission `gorm:"many2many:role_permissions;" json:"permissions"`
	Menus       []*Menu       `gorm:"many2many:role_menus;" json:"menus"`
}

// TableName 设置Role表名
func (r *Role) TableName() string {
	return "role"
}
